<?php

App::uses('AppModel', 'Model');

class Email extends AppModel {

    var $useTable = 'email'; // nome della tabella

	public function beforeSave($options = array()) {
		$viewvars = new stdClass();
		if (isset($this->data[$this->alias]["viewvars"])) {
			$viewvars = json_decode($this->data[$this->alias]["viewvars"]);
		}
		
    	$viewvars->base_url = Router::url("/",true);
		
		$this->set("viewvars",json_encode($viewvars));
		return true;
	}
    
}


?>